package com.novel.service.impl;

import com.novel.mapper.ReplyMapper;
import com.novel.service.ReplySerive;
import com.reading.pojo.Reply;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDateTime;
import java.util.List;

@Transactional
@Service
public class ReplyServiceImpl implements ReplySerive {
    @Resource
    private ReplyMapper replyMapper;

    @Override
    public List<Reply> findall(Integer pid) {
        return replyMapper.findall(pid);
    }

    @Override
    public int add(Reply reply) {
        reply.setTime(LocalDateTime.now());
        return replyMapper.add(reply);
    }
}
